package com.example.computer_exam_training_sys.mapper;

import com.example.computer_exam_training_sys.vo.AdminUserLogVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface AdminUserLogVOMapper {
    @Select("SELECT a.admin_id as adminId, u.user_id as userId, u.avatar, a.role, a.department, u.username as adminName, l.log_id as logId, l.operation_type, l.operation_detail as description, l.target_type as targetResource, l.ip_address, l.create_time as operateTime FROM admins a LEFT JOIN users u ON a.user_id = u.user_id LEFT JOIN admin_logs l ON l.admin_id = a.admin_id WHERE a.admin_id = #{adminId}")
    java.util.List<AdminUserLogVO> findAdminUserAndLogs(@Param("adminId") Integer adminId);
}
